/*jslint browser: true, devel: true, bitwise: true, white: true, plusplus: true */
/*global $:true, define:true */

/**
 * @module Core
 */

define(function() {
"use strict";

function Interface(name, methods,create) {
	this.Name = name;
	this.Methods = methods;
	return new Interface(name,methods,true);
}

Interface.prototype = {
	constructor: Interface,
	
	// @TODO Maybe added some exception if classType is not class from new system.
	hasImplements: function(classType) {
		var interfaces = classType.Interfaces;
		if (interfaces && classType.Interfaces[this.Name] === this) {
			return true;
		}
		return false;
	},
	
	hasMethods: function(classType) {
		var 
			i,
			methods = this.Methods, 
			len = methods.length,
			proto = classType.prototype;
			
		for (i = 0; i < len;++i) {
			if (!proto[methods[i]]) {
				return false;
			}
		}
	},
	
	hasMethod: function(classType, methodName) {
		if (classType.prototype[methodName]) {
			return true;
		}
		return false;
	}
};

Object.defineProperties(Interface.prototype,{
	name: {
		get: function() {
			return this.Name;
		}
	},
	
	methods: {
		get: function() {
			return this.Methods;
		}
	}
});

return Interface;

});
